

#ifndef _ucutilads_h
#define _ucutilads_h 1


#include "zadsdef.h"
#include "zAdAChar.h"

#pragma pack (push, 8)

void           ucad__assert(const ZTCHAR *, const ZTCHAR *, int);

int            ucutCvUnit (zds_real value, const ZTCHAR *oldunit,
                             const ZTCHAR *newunit, zds_real *result);
int            ucutWcMatch (const ZTCHAR *string, const ZTCHAR *pattern);

int            ucutPrintf (const ZTCHAR *format, ...);
int            ucutSPrintf (ZTCHAR *buffer, size_t nBufLen, const ZTCHAR *format, ...);

struct resbuf *ucutNewRb (int v);
int            ucutRelRb (struct resbuf *rb);
struct resbuf *ucutBuildList (int rtype, ...);

zds_real       ucutAngle (const zds_point pt1, const zds_point pt2);
zds_real       ucutDistance (const zds_point pt1, const zds_point pt2);
void           ucutPolar (const zds_point pt, zds_real angle,
                            zds_real dist, zds_point ptres);

int            ucutIsAlpha (int c);
int            ucutIsUpper (int c);
int            ucutIsLower (int c);
int            ucutIsDigit (int c);
int            ucutIsXDigit (int c);
int            ucutIsSpace (int c);
int            ucutIsPunct (int c);
int            ucutIsAlNum (int c);
int            ucutIsPrint (int c);
int            ucutIsGraph (int c);
int            ucutIsCntrl (int c);
int            ucutToUpper (int c);
int            ucutToLower (int c);

#pragma pack (pop)

#ifdef __cplusplus
int ucutVSPrintf(ZTCHAR* buf, size_t nBufLen, const ZTCHAR* fmt, va_list va);

template<size_t nBufLen> inline int ucutSPrintf(ZTCHAR (& buf)[nBufLen], const ZTCHAR *format, ...)
{
	va_list va;
	va_start(va, format);
	const int nRet = ::ucutVSPrintf(buf, nBufLen, format, va);
	va_end(va);
	return nRet;
}

template<size_t nBufLen> inline int ucutVSPrintf(ZTCHAR (& buf)[nBufLen], const ZTCHAR *format,	va_list va)
{
	return ::ucutVSPrintf(buf, nBufLen, format, va);
}
#endif
// Deprecated: The following method will be removed in a future
int            ucutSPrintf (ZTCHAR *buffer, const ZTCHAR *format, ...);

#endif 
